After learning about the parser of easyui, the next step is to learn about easyloader.What is EasyLoader?
Just like its name, easyloader is used to dynamically load js files required by components, which reflects the rational performance of EasyUI as a lightweight framework (which can dynamically load required components ), however, easyloader is rarely used (whi
After learning about the parser of easyui, the next step is to learn about easyloader.What is easyloader?
Just like its name, easyloader is used to dynamically load JS files required by components. This reflects the rational performance of easyui as a lightweight framework (capable of dynamically loading required components ), easyloader is rarely used in general
The script library is used to load a whole bunch of stylesheets and script files, and in Easyui, in addition to being loaded in the usual way, provides a way to load using Easyloader. This component was created primarily to load components on demand. Under what circumstances should it be used?
You think one-time import Easyui core min js and css too big
You only use a few of the components of Easyui.
You want to use one of these compo
JQueryEasyUI is a quick component built based on JQuery UI. Today we will introduce EasyLoader functions. EasyLoader can dynamically load scripts and CSS files, or dynamically load existing components of EasyUI.
You need to reference the EasyLoader. js file. Note: you do not need to reference the jquery. easyui. min. js file here.
For example, you can use the f
EasyLoader can dynamically load scripts and CSS files, or dynamically load existing components of EasyUI.
You need to reference the EasyLoader. js file. Note: you do not need to reference the jquery. easyui. min. js file here.
For example, you can use the following two methods to load the linkbutton component:
The first method is implemented by setting the class:
As long as easyui-component name is set for
Easyui Study Summary (ii)--easyloader analysis and useThe script library is used to load a whole bunch of stylesheets and script files, and in Easyui, in addition to being loaded in the usual way, provides a way to load using Easyloader. This component was created primarily to load components on demand. Under what circumstances should it be used?
You think one-time import Easyui core min js and css
The Ready event is not necessarily ready.
When using easyloader, you must note the loading time of the script. easyloader loads modules asynchronously. Therefore, the modules you use may not have been loaded. For example, the following code.
It looks very simple and uses jQuery's ready function. Unfortunately, you will find the following errors after executing the command.
TypeError: $. messager is undefin
Http://www.cnblogs.com/haogj/archive/2013/04/22/3036685.htmlThe script library is used to load a whole bunch of stylesheets and script files, and in Easyui, in addition to being loaded in the usual way, provides a way to load using Easyloader.This component was created primarily to load components on demand. Under what circumstances should it be used?
You think one-time import Easyui core min js and css too big
You only use a few of the components of Easyui.
You want to use one
With Easyui for a long time, but seldom to see the source. There is no solution to the problem of Baidu ...Today found that the source of Easyui is not difficult to understand. And the combination of Easyloader can be very convenient to study the components of Easyui.However, Easyloader's official API presentation is very brief.Easyloader.base = '. /‘; Set Easyui base directory easyloader.load (' Messager ', function () {//Load specified module
EasyLoader can dynamically load scripts and CSS files, or dynamically load existing components of EasyUI.You need to reference the EasyLoader. js file. Note: you do not need to reference the jquery. easyui. min. js file here.For example, you can use the following two methods to load the linkbutton component:The first method is implemented by setting the class: As long as easyui-component name is set for the
The previous article introduced the jQueryEasyUI tutorial-Parser (Parser). After learning about jQuery-Parser (Parser), I learned about EasyLoader (simple loader. The previous article introduced the jQuery EasyUI tutorial-Parser (Parser). After learning about jQuery-Parser (Parser), the next step is EasyLoader (simple loader).
Usage:
1. Load the EasyUI Module
Easyloade
Easyui Study Summary (iii)--easyloader source analysisThe Easyloader module is used to load the JS and CSS files of the jquery Easyui, and it can analyze the dependencies of the modules and load the dependencies first. The module loads well and invokes the parse module to parse the page. The tags that start with class Easyui are converted into Easyui controls.First look at the Demo1 example, and then analyz
Easyloader is the ability to load CSS styles, scripts, and dynamically load Easyui components. Need to use to easyloader.js, do not use Jquery.easyui.min.jsLoading the Easyui moduleEasyloader.base = './‘; Set the base directory of the Easyui easyloader.load (' Messager ', function () {//load the specified module $.messager.alert (' Title ', ' load OK ');});Loading scripts with relative URLsThe path of the script relative to the Easyui directory using
Brother even front-end HTML5 training to share Easyloader instances of -jquery Easyui To move the panel to other position $ (' #p '). Panel (' move ', { LEFT:100, top:100 });Property: The title, type is string, is the caption text that is displayed on the panel header, and the default value is null. iconcls, type is string, a 16x16 icon displayed on the panel with a CSS class , and the default value is null. width, type is number, sets the
Easyloader is the ability to dynamically load scripts and CSS files, or to dynamically load Easyui existing componentsYou need to refer to the Easyloader.js file, note: There is no need to reference the Jquery.easyui.min.js file.For example, if you need to load the LinkButton component, you can load it in two ways:The first is done by setting the class:As long as class sets the easyui-component name, Easyloader
The jquery Easyui all have attributes, and we'll explain these methods and their properties here.
Let's look at some base methods first.
Easyloader
Easyloader.base = '.. /'; Set the Easyui base directory
Easyloader.load (' Messager ', function () {//load the specified module
$.messager.alert (' title ', ' Load OK ');
});
The code above is the method used by the Easyloader () method.
When easyloader loads an external js file, although the callback function is successfully called, The js file cannot be loaded. The solution is as follows: Find easyload. open the js file and change the script to this in red; var _ 8 = document. createElement ("script"); _ 8. type = "text/javascript"; _ 8. language = "javascript"; _ 8.src= _ 5; _ 8. onload = _ 8. onreadystatechange = function () {if (! _ 7 (! This. readyState | this. readyState = "loa
Easyloader Load External JS file, although callback function call succeeds, but JS file is not loaded, the solution is as follows:
Locate the Easyload.js file and open the following location: Red font section change script to this;
var _8=document.createelement ("script");_8.type= "Text/javascript";_8.language= "JavaScript";_8.src=_5;_8.onload=_8.onreadystatechange=function () {if (!_7 (!this.readystate| | this.readystate== "Loaded" | | this.readyst
Easyloader can dynamically load scripts and CSS files, or dynamically load Easyui existing componentsNeed to refer to Easyloader.js file, note: There is no need to refer to the Jquery.easyui.min.js file.For example, if you need to load the LinkButton component, you can load it in the following two ways:The first way to do this is by setting class:Easyloader automatically loads the appropriate component as long as the class sets the easyui-component na
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.